#ifndef INCLUDE_S_EXCEPTION_H_
#define INCLUDE_S_EXCEPTION_H_
#include "common_cap.h"
#include <amqp.h>
#include <amqp_framing.h>
#include <stdarg.h>
#ifdef __cplusplus
extern "C"{
#endif
class CException{
public:
	CException();
	~CException();
public:
	void die(const char *fmt, ...);
	void die_on_error(int x, char const *context);
	void die_on_amqp_error(amqp_rpc_reply_t x, char const *context);

	void amqp_dump(void const *buffer, size_t len);

//	uint64_t now_microseconds(void);
//	void microsleep(int usec);
private:
	void dump_row(long count, int numinrow, int *chs);
	int rows_eq(int *a, int *b);
};
#ifdef __cplusplus
}
#endif
#endif/*INCLUDE_S_EXCEPTION_H_*/
